package com.cicc.springboot.controller;

import com.cicc.springboot.common.dto.R;
import com.cicc.springboot.service.FileInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @ClassName FileUploadController
 * @Description TODO
 * @Author 转轮王
 * @Date 2024/10/10 11:42
 * @Version 1.0
 */


@RestController
public class FileUploadController {


    @Autowired
    private FileInfoService fileUploadService;

    @PostMapping("/upload")
    public R<String> upload(@RequestParam("files") MultipartFile[] files, @RequestParam("attachmentId") String attachmentId) {

        return fileUploadService.uploadFiles(files, attachmentId);
    }

}
